<?php

/*
Contact Authority (admin_contact_authority.php)
*/

$page_title = "Contact Authority";
$rank_check = 7;
include "../header.inc.php";

if ($page == "process")
{
	if ($contact == "police_plus") { $status_to = "4"; }
	if ($contact == "mods_plus") { $status_to = "5"; }
	if ($contact == "admins") { $status_to = "7"; }
	
	$find_send_to = mysql_query("SELECT id FROM members2 WHERE rank >= '$status_to' AND game = '$game'");
	$contact_message = "<b>$contact_subject</b><Br><br>$contact_message<br><br>This message was sent to all $contact, sent by $username";
	while ($send_letter = mysql_fetch_array($find_send_to))
	{
		systemmessage("$game", "", "$send_letter[id]", "$contact_message");
	}
	header(error("admin_contact_authority.php?game=$game","Letter sent to all $contact"));
}

print "$openHTML";

ECHO <<<END
<p><form action=admin_contact_authority.php?game=$game method=post><input type=hidden name=page value=process>
Contact all:<br>
<select name=contact>
<option value=police_plus>Police, Mods and Admins
<option value=mods_plus>Mods and Admins
<option value=admins>Admins
</select><br>
Subject:<br>
<input type=text name=contact_subject value="$gameName2 Staff"><br>
Message:<br>
<TEXTAREA NAME=contact_message ROWS=14 COLS=50 WRAP=virtual></TEXTAREA><br>
<input type=submit value="Send Letter">
</form></p>
END;

print "$closeHTML";
?>
